home *** CD-ROM | disk | FTP | other *** search
- Program ConVerTLog {3.0 to 3.1};
-
- Type
- Datestring = string[8];
- CommentString = string[12];
- Filename = string[24];
-
- LogRec31 = Record
- usage: char; {usage type, i.e. business/personal}
- start_date_log : Datestring; {start date}
- start_time_log : Datestring; {start time}
- end_time_log : Datestring; {end time}
- elapsed_log : Datestring; {elapsed time}
- comment : CommentString; {comment}
- end;
-
- LogRec30 = Record
- usage: char; {usage type, i.e. business/personal}
- start_date_log : Datestring; {start date}
- start_time_log : Datestring; {start time}
- end_time_log : Datestring; {end time}
- elapsed_log : Datestring; {elapsed time}
- comment : CommentString; {comment}
- elapsed_real : Real; {elapsed time stored as real no.}
- end;
-
- Var
- logfile31 : file of LogRec31;
- logfile30 : file of LogRec30;
- log_data30 : logrec30;
- log_data31 : logrec31;
- i : integer;
- ch : char;
-
- Const
- logfile31name : filename = 'TIME31.LOG';
- logfile30name : filename = 'TIME30.LOG';
-
-
- Procedure initialize_variables;
- begin
- log_data31.comment:= '';
- end;
-
-
- Begin {program}
-
- lowvideo;
- writeln;
- writeln('This program will convert a LOG V 3.0 TIME.LOG file to a');
- writeln('LOG V 3.1 TIME.LOG file. First you must rename the 3.0');
- writeln('TIME.LOG file to TIME30.LOG. This program will then create');
- writeln('the file TIME31.LOG, which you must rename TIME.LOG in order');
- writeln('to use it with the LOG program. This may seem like a lot of');
- writeln('screwing around, but it''ll help prevent accidentally overwriting');
- writeln('wanted files. Besides, what do you expect for free?');
- writeln;
- writeln('Press any key to continue, ^C to abort...');
- read(kbd,ch);
- initialize_variables;
-
- Assign(logfile31,logfile31name);
- Rewrite(logfile31);
- Assign(logfile30,logfile30name);
- reset(logfile30);
-
- for i:=0 to filesize(logfile30)-1 do
- begin
- seek(logfile30,i);
- read(logfile30,log_data30);
- log_data31.usage:= log_data30.usage;
- if log_data31.usage=#0 then log_data31.usage:='@';
- log_data31.start_date_log:= log_data30.start_date_log;
- log_data31.start_time_log:= log_data30.start_time_log;
- log_data31.end_time_log:= log_data30.end_time_log;
- log_data31.elapsed_log:= log_data30.elapsed_log;
- if length(log_data30.comment)>0 then
- log_data31.comment:=copy(log_data30.comment,1,12);
- seek(logfile31,filesize(logfile31));
- write(logfile31,log_data31);
- writeln;
- writeln(log_data31.usage);
- writeln(log_data31.start_date_log);
- writeln(log_data31.start_time_log);
- writeln(log_data31.end_time_log);
- writeln(log_data31.elapsed_log);
- writeln(log_data31.comment);
- end; {for}
-
- Close(logfile31);
- Close(logfile30);
-
- End.